package com.hzeport.bgs22emduty.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.hzeport.bgs22emduty.enums.STypeEnum;
import com.hzeport.bgs22emduty.enums.SettingModeEnum;
import com.hzeport.bgs22emduty.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("EMDU_BASE_CUSTOM_PHONE")
@ApiModel(value = "值班电话表")
public class BaseCustomPhone extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "关区GUID，源自H4A")
    @TableField(value = "CUSTOM_ID")
    @JsonProperty(value = "customId")
    private String customId;

    @ApiModelProperty(value = "电话号码，值班电话号码")
    @TableField(value = "PHONE_TEL")
    @JsonProperty(value = "phoneTel")
    private String phoneTel;

    @ApiModelProperty(value = "传真号码")
    @TableField(value = "FAX")
    @JsonProperty(value = "fax")
    private String fax;

    @ApiModelProperty(value = "旧版值班类型：1.全天；2.工作日白天； 3.工作日夜间 ，节假日；")
    @TableField(value = "DAY_TYPE")
    @JsonProperty(value = "dayType")
    private String dayType;

    @ApiModelProperty(value = "节假日表关联ID，关联节假日表PARAM_HOLIDAYS主键ID")
    @TableField(value = "HOILDAY_ID")
    @JsonProperty(value = "hoildayId")
    private String hoildayId;

    /**
     * @see STypeEnum
     */
    @ApiModelProperty(value = "值班类型：1.日常班；2.节假日；3.重要日；4.周末班")
    @TableField(value = "SCHEDULE_TYPE")
    @JsonProperty(value = "sType")
    private String sType;

    @ApiModelProperty(value = "值班时段ID，关联值班时段配置表PARAM_DUTY主键ID")
    @TableField(value = "PARAM_DUTY_ID")
    private String paramDutyId;

    /**
     * @see SettingModeEnum
     */
    @ApiModelProperty(value = "配置模式：1. 后台页面配置；null：数据库插入（旧配置）")
    @TableField(value = "SETTING_MODE")
    private String settingMode;

    public void setSType(STypeEnum sTypeEnum) {
        this.sType = sTypeEnum.getCode();
    }

    public void setSType(String sType) {
        this.sType = sType;
    }

    public void setSettingMode(SettingModeEnum settingModeEnum) {
        this.settingMode = settingModeEnum.getCode();
    }

    public void setSettingMode(String settingMode) {
        this.settingMode = settingMode;
    }
}
